<%@ page language="java" contentType="text/html; charset=UTF-8" isELIgnored="false"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../css/public.css" media="all">
</head>
<body>

<script src="https://eqcn.ajz.miesnfu.com/wp-content/plugins/wp-3d-pony/live2dw/lib/L2Dwidget.min.js"></script>
<script>
    L2Dwidget.init({
        "model": { "jsonPath":"https://unpkg.com/live2d-widget-model-haruto@1.0.5/assets/haruto.model.json", "scale": 1, "hHeadPos":0.5, "vHeadPos":0.618 },
        "display": { "position": "right", "width": 100, "height": 200, "hOffset": 0, "vOffset": 0 },
        "mobile": { "show": true, "scale": 0.5 },
        "react": { "opacityDefault": 0.7, "opacityOnHover": 0.2 }
    });
</script>

<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script>
    $(function(){
        function n(n,e,t){
            return n.getAttribute(e)||t
        }
        function e(n){
            return document.getElementsByTagName(n)
        }
        function t(){
            var t=e("script"),o=t.length,i=t[o-1];
            return{l:o,z:n(i,"zIndex",-1),o:n(i,"opacity",.6),c:n(i,"color","46,139,87"),n:n(i,"count",150)}
        }
        function o(){
            a=m.width=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,
                c=m.height=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight
        }
        function i(){
            r.clearRect(0,0,a,c);
            var n,e,t,o,m,l;
            s.forEach(function(i,x){
                for(i.x+=i.xa,i.y+=i.ya,i.xa*=i.x>a||i.x<0?-1:1,i.ya*=i.y>c||i.y<0?-1:1,r.fillRect(i.x-.5,i.y-.5,1,1),e=x+1;e<u.length;e++)n=u[e],
                null!==n.x&&null!==n.y&&(o=i.x-n.x,m=i.y-n.y,
                    l=o*o+m*m,l<n.max&&(n===y&&l>=n.max/2&&(i.x-=.03*o,i.y-=.03*m),
                    t=(n.max-l)/n.max,r.beginPath(),r.lineWidth=t/2,r.strokeStyle="rgba("+d.c+","+(t+.2)+")",r.moveTo(i.x,i.y),r.lineTo(n.x,n.y),r.stroke()))
            }),
                x(i)
        }
        var a,c,u,m=document.createElement("canvas"),d=t(),l="c_n"+d.l,r=m.getContext("2d"),
            x=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||
                function(n){
                    window.setTimeout(n,1e3/45)
                },
            w=Math.random,y={x:null,y:null,max:2e4};m.id=l,m.style.cssText="position:fixed;top:0;left:0;z-index:"+d.z+";opacity:"+d.o,e("body")[0].appendChild(m),o(),window.onresize=o,
            window.onmousemove=function(n){
                n=n||window.event,y.x=n.clientX,y.y=n.clientY
            },
            window.onmouseout=function(){
                y.x=null,y.y=null
            };
        for(var s=[],f=0;d.n>f;f++){
            var h=w()*a,g=w()*c,v=2*w()-1,p=2*w()-1;s.push({x:h,y:g,xa:v,ya:p,max:6e3})
        }
        u=s.concat([y]),
            setTimeout(function(){i()},100)
    });
</script>

<script>
    /* --   Beautiful Mouse  -- */
    var a_idx = 0;
    jQuery(document).ready(function ($) {
        $("body").click(function (e) {
            var a = new Array("❤富强❤", "❤民主❤", "❤和谐❤", "❤文明❤", "❤自由❤", "❤平等❤", "❤公正❤", "❤法治❤",
                "❤爱国❤", "❤敬业❤", "❤诚信❤", "❤友善❤");
            var $i = $("<span></span>").text(a[a_idx]);
            a_idx = (a_idx + 5) % a.length;
            var x = e.pageX,
                y = e.pageY;
            $i.css({
                "z-index": 999999999999999999999999999999999999999999999999999999999999999999999,
                "top": y - 20,
                "left": x,
                "position": "absolute",
                "font-weight": "bold",
                "color": "rgb(" + Math.floor(Math.random() * 255) + "," + Math.floor(Math
                    .random() * 255) + "," + Math.floor(Math.random() * 255) + ")"
            });
            $("body").append($i);
            $i.animate({
                    "top": y - 180,
                    "opacity": 1
                },
                3000,
                function () {
                    $i.remove();
                });
        });
    });
</script>

<script>
    /*样式一*/
    (function($){
        $.fn.snow = function(options){
            var $flake = $('<div id="snowbox" />').css({'position': 'absolute','z-index':'9999', 'top': '0px'}).html('&#10052;'),
                documentHeight 	= $(document).height(),
                documentWidth	= $(document).width(),
                defaults = {
                    minSize		: 10,
                    maxSize		: 20,
                    newOn		: 1000,
                    flakeColor	: "#A020F0" /* 此处可以定义雪花颜色，若要白色可以改为#FFFFFF */
                },
                options	= $.extend({}, defaults, options);
            var interval= setInterval( function(){
                var startPositionLeft = Math.random() * documentWidth - 100,
                    startOpacity = 0.5 + Math.random(),
                    sizeFlake = options.minSize + Math.random() * options.maxSize,
                    endPositionTop = documentHeight - 200,
                    endPositionLeft = startPositionLeft - 500 + Math.random() * 500,
                    durationFall = documentHeight * 10 + Math.random() * 5000;
                $flake.clone().appendTo('body').css({
                    left: startPositionLeft,
                    opacity: startOpacity,
                    'font-size': sizeFlake,
                    color: options.flakeColor
                }).animate({
                    top: endPositionTop,
                    left: endPositionLeft,
                    opacity: 0.2
                },durationFall,'linear',function(){
                    $(this).remove()
                });
            }, options.newOn);
        };
    })(jQuery);
    $(function(){
        $.fn.snow({
            minSize: 5, /* 定义雪花最小尺寸 */
            maxSize: 10,/* 定义雪花最大尺寸 */
            newOn: 1000  /* 定义密集程度，数字越小越密集 */
        });
    });
</script>


<div class="layuimini-container">
    <div class="layuimini-main">

        <fieldset class="table-search-fieldset">
            <legend>搜索信息</legend>
            <div style="margin: 10px 10px 10px 10px">
                <form class="layui-form layui-form-pane" action="">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">商品名</label>
                            <div class="layui-input-inline">
                                <input type="text" name="goodsname" id="goodsname" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <button type="button" id="searchbtn" class="layui-btn layui-btn-primary"  lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>
                            <button id="addbtn" type="button" class="layui-btn" >新商品入库</button>
                            <button type="button" id="insumbtn" class="layui-btn layui-btn-warm layui-btn-radius">统计入库数量</button>
                            <button type="button" id="outsumbtn" class="layui-btn layui-btn-warm layui-btn-radius">出库数量统计</button>
                        </div>
                    </div>
                </form>
            </div>
        </fieldset>

        <script type="text/html" id="toolbarDemo">
            <div class="layui-btn-container">
                <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add"> 添加 </button>
                <button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete"> 删除 </button>
            </div>
        </script>


        <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>

        <script type="text/html" id="currentTableBar">
            <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
            <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">出库</a>
        </script>
        <script type="text/html" id="goodsForm">

            <form class="layui-form" action="" lay-filter="goodsForm">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label"></label>
                        <div class="layui-input-inline">
                            <input type="hidden" id="id" name="id" lay-verify="required|phone" autocomplete="off" class="layui-input demo-phone">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">商品名称</label>
                        <div class="layui-input-inline">
                            <input type="text" id="name" name="name" lay-verify="required|phone" autocomplete="off" class="layui-input demo-phone">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">生产公司</label>
                        <div class="layui-input-inline">
                            <input type="text" id="factory" name="factory" lay-verify="required|phone" autocomplete="off" class="layui-input demo-phone">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">产品型号</label>
                        <div class="layui-input-inline">
                            <input type="text" id="model" name="model" lay-verify="required|phone" autocomplete="off" class="layui-input demo-phone">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">产品规格</label>
                        <div class="layui-input-inline">
                            <input type="text" id="size" name="size" lay-verify="required|phone" autocomplete="off" class="layui-input demo-phone">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">产品数量</label>
                        <div class="layui-input-inline">
                            <input type="text" id="number" name="number" lay-verify="required|phone" autocomplete="off" class="layui-input demo-phone">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">负责单位</label>
                        <div class="layui-input-inline">
                            <input type="text" id="actionpart" name="actionpart" lay-verify="required|phone" autocomplete="off" class="layui-input demo-phone">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">负责人</label>
                        <div class="layui-input-inline">
                            <input type="text" id="chargeman" name="chargeman" lay-verify="required|phone" autocomplete="off" class="layui-input demo-phone">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">

                        <button id="savebtn" type="button" class="layui-btn" >保存</button>
                        <button type="reset" class="layui-btn" >重置</button>

                    </div>
                </div>
        </script>
        <script type="text/html" id="goodsForm2">
            <form class="layui-form" action="" lay-filter="goodsForm2">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">负责单位</label>
                        <div class="layui-input-inline">
                            <input type="text" id="actionpart" name="actionpart" lay-verify="required|phone" autocomplete="off" class="layui-input demo-phone">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">负责人</label>
                        <div class="layui-input-inline">
                            <input type="text" id="chargeman" name="chargeman" lay-verify="required|phone" autocomplete="off" class="layui-input demo-phone">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">

                        <button id="savebtn2" type="button" class="layui-btn" >保存</button>
                        <button type="reset" class="layui-btn" >重置</button>

                    </div>
                </div>
        </script>
        <script type="text/html" id="goodsForm3">

            <form class="layui-form" action="" lay-filter="goodsForm3">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label"></label>
                        <div class="layui-input-inline">
                            <input type="hidden" id="id" name="id" lay-verify="required|phone" autocomplete="off" class="layui-input demo-phone">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">商品名称</label>
                        <div class="layui-input-inline">
                            <input type="text" id="name" name="name" lay-verify="required|phone" autocomplete="off" class="layui-input demo-phone">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">生产公司</label>
                        <div class="layui-input-inline">
                            <input type="text" id="factory" name="factory" lay-verify="required|phone" autocomplete="off" class="layui-input demo-phone">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">产品型号</label>
                        <div class="layui-input-inline">
                            <input type="text" id="model" name="model" lay-verify="required|phone" autocomplete="off" class="layui-input demo-phone">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">产品规格</label>
                        <div class="layui-input-inline">
                            <input type="text" id="size" name="size" lay-verify="required|phone" autocomplete="off" class="layui-input demo-phone">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">产品数量</label>
                        <div class="layui-input-inline">
                            <input type="text" id="number" name="number" lay-verify="required|phone" autocomplete="off" class="layui-input demo-phone">
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-input-block">

                        <button id="savebtn" type="button" class="layui-btn" >保存</button>
                        <button type="reset" class="layui-btn" >重置</button>

                    </div>
                </div>
        </script>
        <script type="text/html" id="insumForm">

            <form class="layui-form" action="" lay-filter="insumForm">
                <div class="layui-form-item">

                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label"></label>
                            <div class="layui-input-inline">
                                <input type="text" id="byyear" name="byyear" placeholder="日期格式：xxxx" lay-verify="required|phone" autocomplete="off" class="layui-input demo-phone">
                                <button id="yearbtn" type="button" class="layui-btn" >年份查询</button>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label"></label>
                            <div class="layui-input-inline">
                                <input type="text" id="bymonth" name="bymonth" placeholder="日期格式：xxxx-xx" lay-verify="required|phone" autocomplete="off" class="layui-input demo-phone">
                                <button id="monthbtn" type="button" class="layui-btn" >月份查询</button>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label"></label>
                            <div class="layui-input-inline">
                                <input type="text" id="byday" name="byday" placeholder="日期格式：xxxx-xx-xx" lay-verify="required|phone" autocomplete="off" class="layui-input demo-phone">
                                <button id="daybtn" type="button" class="layui-btn" >日期查询</button>
                            </div>
                        </div>
                    </div>



                    <div class="layui-form-item">
                        <div class="layui-input-block">


                            <button type="reset" class="layui-btn" >重置</button>

                        </div>
                    </div>
        </script>


        <script type="text/html" id="resultForm">

            <form class="layui-form" action="" lay-filter="resultForm">
                <div class="layui-form-item">

                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">统计结果</label>
                            <div class="layui-input-inline">
                                <input type="text" id="resultsum" name="resultsum"  lay-verify="required|phone" autocomplete="off" class="layui-input demo-phone">
                            </div>
                        </div>
                    </div>

        </script>

    </div>
</div>
<script src="../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
    layui.use(['form', 'table','layer','laydate'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table,
            layer= layui.layer
        laydate=layui.laydate
        ;
        //对搜索写操作
        $("#searchbtn").on("click",function(){

            table.render({
                elem: '#currentTableId',
                url: '/goods',
                where:{keyword:$("#goodsname").val(),action:"list"},
                cols: [[
                    {type: "checkbox", width: 50},
                    {field: 'id', width: 150, title: 'ID', sort: true},
                    {field: 'name', width: 150, title: '产品名称'},
                    {field: 'factory', width: 150, title: '成产厂家', sort: true},
                    {field: 'model', width: 150, title: '产品型号'},
                    {field: 'size', title: '产品规格', minWidth: 150},
                    {field: 'number', minWidth: 150, title: '产品数量'},
                    {title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
                ]],
                limits: [10, 15, 20, 25, 50, 100],
                limit: 15,
                page: true,
                skin: 'line'
            }) ;

        }).click();


        //对统计出库数量写操作
        $("#outsumbtn").on("click",function(){
            //先发请求查所有部门
            //[{"id":1,"name":"财务"},{},{}]



            layer.open({
                type:1,
                title:"出库数量搜索",
                area:["400px","500px"],
                content:$("#insumForm").html()

            });


            //渲染表单
            form.render();
            //绑定按年查找按钮的事件
            $("#yearbtn").on("click",function(){
                //打包form表单中的所有数据

                var data=form.val("insumForm");
                var databyyear = data.byyear;
                //发请求把数据推送到后台
                $.post("/goods",{action:"outsumbyyear",year:databyyear},function(data){
                    //请求成功后，1关窗口，2，点搜索
                    layer.open({
                        type:1,
                        title:"统计结果",
                        area:["200px","400px"],
                        content:$("#resultForm").html()

                    });

                    $("#resultsum").val(data.data);
                });

            });
            form.render();
            //绑定按年查找按钮的事件
            $("#monthbtn").on("click",function(){
                //打包form表单中的所有数据

                var data=form.val("insumForm");
                var databymonth = data.bymonth;
                //发请求把数据推送到后台
                $.post("/goods",{action:"outsumbymonth",month:databymonth},function(data){
                    //请求成功后，1关窗口，2，点搜索
                    layer.open({
                        type:1,
                        title:"统计结果",
                        area:["200px","200px"],
                        content:$("#resultForm").html()

                    });
                    $("#resultsum").val(data.data);
                });

            });
            //绑定按日查找按钮的事件
            $("#daybtn").on("click",function(){
                //打包form表单中的所有数据

                var data=form.val("insumForm");
                var databyday = data.byday;
                //发请求把数据推送到后台
                $.post("/goods",{action:"outsumbyday",day:databyday},function(data){
                    //请求成功后，1关窗口，2，点搜索
                    layer.open({
                        type:1,
                        title:"统计结果",
                        area:["200px","200px"],
                        content:$("#resultForm").html()

                    });
                    $("#resultsum").val(data.data);
                });

            });
            //渲染表单
            form.render();
        });

        //对统计入库数量写操作
        $("#insumbtn").on("click",function(){
            //先发请求查所有部门
            //[{"id":1,"name":"财务"},{},{}]



            layer.open({
                type:1,
                title:"入库数量搜索",
                area:["400px","500px"],
                content:$("#insumForm").html()

            });


            //渲染表单
            form.render();
            //绑定按年查找按钮的事件
            $("#yearbtn").on("click",function(){
                //打包form表单中的所有数据

                var data=form.val("insumForm");
                var databyyear = data.byyear;
                //发请求把数据推送到后台
                $.post("/goods",{action:"insumbyyear",year:databyyear},function(data){
                    //请求成功后，1关窗口，2，点搜索
                    layer.open({
                        type:1,
                        title:"统计结果",
                        area:["200px","400px"],
                        content:$("#resultForm").html()

                    });

                    $("#resultsum").val(data.data);
                });

            });
            form.render();
            //绑定按年查找按钮的事件
            $("#monthbtn").on("click",function(){
                //打包form表单中的所有数据

                var data=form.val("insumForm");
                var databymonth = data.bymonth;
                //发请求把数据推送到后台
                $.post("/goods",{action:"insumbymonth",month:databymonth},function(data){
                    //请求成功后，1关窗口，2，点搜索
                    layer.open({
                        type:1,
                        title:"统计结果",
                        area:["200px","200px"],
                        content:$("#resultForm").html()

                    });
                    $("#resultsum").val(data.data);
                });

            });
            //绑定按日查找按钮的事件
            $("#daybtn").on("click",function(){
                //打包form表单中的所有数据

                var data=form.val("insumForm");
                var databyday = data.byday;
                //发请求把数据推送到后台
                $.post("/goods",{action:"insumbyday",day:databyday},function(data){
                    //请求成功后，1关窗口，2，点搜索
                    layer.open({
                        type:1,
                        title:"统计结果",
                        area:["200px","200px"],
                        content:$("#resultForm").html()

                    });
                    $("#resultsum").val(data.data);
                });

            });
            //渲染表单
            form.render();
        });


        //给新增按钮绑定事件
        $("#addbtn").on("click",function(){
            //先发请求查所有部门
            //[{"id":1,"name":"财务"},{},{}]


            //查成功之后走下面的代码
            layer.open({
                type:1,
                title:"产品入库",
                area:["400px","600px"],
                content:$("#goodsForm").html()

            });
            laydate.render({
                elem:'#actiondate'
            });

            //渲染表单
            form.render();
            //绑定保存按钮的事件
            $("#savebtn").on("click",function(){
                //打包form表单中的所有数据
                var data=form.val("goodsForm");
                data.action="save";
                //发请求把数据推送到后台
                $.post("/goods",data,function(){
                    //请求成功后，1关窗口，2，点搜索
                    layer.closeAll();
                    $("#searchbtn").click();
                });
                setTimeout(function(){
                    window.location.reload ();// 刷新当前页面.
                },0);
            });

            //渲染表单
            form.render();
        });



        //监听表格复选框选择
        table.on('checkbox(currentTableFilter)', function (obj) {
            console.log(obj)
        });
        //每条员工记录的删除或者修改
        table.on('tool(currentTableFilter)', function (obj) {

            if(obj.event == "edit"){
                $.get("/goods?id="+obj.data.id,function(depts){
                    //查成功之后走下面的代码
                    layer.open({
                        type:1,
                        title:"修改产品信息",
                        area:["400px","500px"],
                        content:$("#goodsForm3").html()
                    });

                    //渲染表单
                    form.render();
                    //为input内传默认值
                    var emp =obj.data;
                    $("#id").val(emp.id);
                    $("#name").val(emp.name);
                    $("#factory").val(emp.factory);
                    $("#model").val(emp.model);
                    $("#size").val(emp.size);
                    $("#number").val(emp.number);

                    laydate.render({
                        elem:'#actiondate'
                    });
                    form.render();
                    //绑定保存按钮的事件
                    $("#savebtn").on("click",function(){
                        //打包form表单中的所有数据
                        let data=form.val("goodsForm3");
                        data.action='save';
                        console.log(data);
                        //发请求把数据推送到后台
                        $.post("/goods",data,function(){
                            //请求成功后，1关窗口，2，点搜索
                            layer.closeAll();
                            $("#searchbtn").click();
                        });
                    });

                    //渲染表单
                    form.render();

                });}
            if(obj.event == "delete"){
                layer.open({
                    type:1,
                    title:"产品出库",
                    area:["400px","200px"],
                    content:$("#goodsForm2").html()
                });
                form.render();
                $("#savebtn2").on("click",function(){
                    //打包form表单中的所有数据
                    var data=form.val("goodsForm2");
                    data.action="save2";
                    $.post("/goods",data,function(){});
                    layer.confirm("您要出库该产品吗?",function(){
                        //通知后台删除该员工(发请求)

                        $.post("/goods",{id:obj.data.id,action:"delete"},function(){
                            //关窗口
                            layer.closeAll();
                            //重新渲染一边table表格数据
                            setTimeout(function(){
                                window.location.reload ();// 刷新当前页面.
                            },0);
                            $("#searchbtn").click();

                        });
                    });
                });
            }

        });
    });
</script>

</body>
</html>